package app.contact;

import app.Numero.NumeroDomicile;
import app.Numero.NumeroPortable;
import app.mail.AdresseMail;


public class Personne{
		private String nom;
		private String prenom;
		private String civilites;
		private NumeroPortable numPort;
		private NumeroDomicile numDom;
		private String adresse;
		private AdresseMail sonMail;
		
		
		public Personne(String nom, String prenom, String civilites,
				NumeroPortable numPort, NumeroDomicile numDom, String adresse,
				AdresseMail sonMail) {
			super();
			this.nom = nom;
			this.prenom = prenom;
			this.civilites = civilites;
			this.numPort = numPort;
			this.numDom = numDom;
			this.adresse = adresse;
			this.sonMail = sonMail;
		}




		public String getNom() {
			return nom;
		}


		public void setNom(String nom) {
			this.nom = nom;
		}


		public String getPrenom() {
			return prenom;
		}


		public void setPrenom(String prenom) {
			this.prenom = prenom;
		}


		public String getCivilites() {
			return civilites;
		}


		public void setCivilites(String civilites) {
			this.civilites = civilites;
		}


		public NumeroPortable getNumPort() {
			return numPort;
		}


		public void setNumPort(NumeroPortable numPort) {
			this.numPort = numPort;
		}


		public NumeroDomicile getNumDom() {
			return numDom;
		}


		public void setNumDom(NumeroDomicile numDom) {
			this.numDom = numDom;
		}


		public String getAdresse() {
			return adresse;
		}


		public void setAdresse(String adresse) {
			this.adresse = adresse;
		}


		public AdresseMail getSonMail() {
			return sonMail;
		}


		public void setSonMail(AdresseMail sonMail) {
			this.sonMail = sonMail;
		}




		@Override
		public String toString() {
			return "Personne [nom=" + nom + ", prenom=" + prenom
					+ ", civilites=" + civilites + ", numPort=" + numPort
					+ ", numDom=" + numDom + ", adresse=" + adresse
					+ ", sonMail=" + sonMail + "]\n";
		}
		
		
		public String toString2() {
			return "nom=" + nom + ", prenom=" + prenom
					+ ", civilites=" + civilites + ", numPort=" + numPort
					+ ", numDom=" + numDom + ", adresse=" + adresse
					+ ", sonMail=" + sonMail;
		}
		
		@Override
		public boolean equals(Object obj) {
			if (this.getClass().toString().equalsIgnoreCase(obj.getClass().toString())){
				if(this.nom.equals(((Personne) obj).getNom()) && this.prenom.equals(((Personne) obj).getPrenom()) && this.civilites.equals(((Personne) obj).getCivilites()) && this.numPort == (((Personne) obj).getNumPort()) && this.numDom == (((Personne) obj).getNumDom()) && this.adresse.equals(((Personne) obj).getAdresse()) && (this.sonMail.getLeMail()).equals(((Personne) obj).getSonMail().getLeMail())) {
					return true;
				}
				else {
					return false;
				}
			}
			else {
				return false;
			}
		}
}
